package code.module.chat
{
	import code.common.assets.AssetsClassName;
	import code.main.controller.event.EventManager;
	import code.main.controller.event.EventName;
	import code.main.modle.lang.Language;
	
	import com.bit101.components.Text;
	import com.greensock.TweenLite;
	import com.yy.manager.ResourceManager;
	import com.yy.tools.menu.Menu;
	import com.yy.tools.text.TextTool;
	import com.yy.yyui.scroll.ScrollPanel;
	import com.yy.yyui.scroll.ScrollPlus;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.ContextMenuEvent;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.ui.ContextMenuItem;
	
	/**
	 *聊天面板 
	 * @author YY
	 * 
	 */
	public class ChatPanel extends Sprite
	{
		public var sendChatBtn:DisplayObject;//发送按钮
		public var chatInput:TextField;//聊天输入框
		public var contentSP:ScrollPanel;
		public var content:TextField;
		public function ChatPanel()
		{
			init();
		} 
		
		private function init():void {
			var dobj:DisplayObject;
			var up:DisplayObject = ResourceManager.getDisplayObjectByName(AssetsClassName.ChatUpBtn);
			var down:DisplayObject = ResourceManager.getDisplayObjectByName(AssetsClassName.ChatDownBtn);;
			var block:DisplayObject = ResourceManager.getDisplayObjectByName(AssetsClassName.ChatScrollBlock);;
			contentSP = new ScrollPanel(275, 62, block, up, down, null, true, 5, 5,false, false);
			dobj = addChild(contentSP);
			dobj.x = 3;
			
			content = TextTool.getTextField("", 0xffffff, 250, 70, "left", true);
			contentSP.contentPanel.addChild(content);
			
			sendChatBtn = ResourceManager.getDisplayObjectByName(AssetsClassName.SendMsgBtn);
			dobj = addChild(sendChatBtn);
			dobj.y = 74;
			dobj.x = 257;
			
			var mc:MovieClip = ResourceManager.getMovieClipByName(AssetsClassName.InputBar);
			dobj = addChild(mc);
			dobj.x = 4;
			dobj.y = 73;
			chatInput = mc.content;
			chatInput.maxChars = 50;
		}
		
		/**
		 *销毁对象 
		 * 
		 */
		public function dispose():void {
		}
		
		
		/**
		 *清除聊天内容 
		 * 
		 */
		public function clear(obj:Object=null):void {
			content.text = "";
		}
		/**
		 *显示聊天内容 
		 * @param msg
		 * 
		 */
		public function showText(msg:String):void {
			content.htmlText = msg;
		}
		
		
		/**
		 *显示快速回复面板 
		 * 
		 */
		public function showFastReply():void {
		}
		public function hideFashReply():void {
		}
	}
}